<template>
  <a-config-provider :locale="zh_CN">
    <div id="app">
      <div v-if="flag" class="appBody content">
        <SubMenu />
        <div class="contentChild">
          <TopMenus />
          <div class="routerView">
            <router-view/>
          </div>
        </div>
      </div>
      <div v-else class="appBody">
        <router-view/>
      </div>
    </div>
  </a-config-provider>
</template>
<script>
import SubMenu from '@/common/subMenus/index'
import TopMenus from '@/common/topMenus/index'
import zh_CN from "ant-design-vue/lib/locale-provider/zh_CN";
import moment from "moment";
import "moment/locale/zh-cn";

moment.locale("zh-cn");
export default {
  name: 'App',
  components:{
    SubMenu,
    TopMenus
  },
  data(){
    return {
      flag: false,
      zh_CN
    }
  },
  watch:{
    $route(to,from){
      this.flag = true;
      if(to.path === '/login' || to.path === '/forget') this.flag = false
    }
  },
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
}
body{

}
.appBody{height: 100%;}
.content{
  display: flex;
  background: #F5F5F5;
}
.contentChild{
  width: calc(100% - 210px);
}
.routerView{
  height: calc(100% - 48px);
  padding: 24px;
  box-sizing: border-box;
}
.ant-btn-primary,.ant-btn-primary:focus,.ant-btn-primary:hover{
  background: #006AFF;
  border: #006AFF;
}
</style>
